package edu.sctu.practice.class02.xuqianlan.test.test02;

/**
 * Created by lenovo on 2015/10/14.
 */
public class Vehicle {
    private int speed;
    private int size;


    public void move() {
        System.out.println("一般来说是匀速行驶");

    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public void speedUp() {
        speed++;
        this.speed = speed;
        System.out.println("加速后的速度是：" + speed);

    }

    public void speedDown() {
        speed--;
        this.speed = speed;
        System.out.println("减速后的速度是：" + speed);

    }

    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.setSpeed(60);
        vehicle.size = 300;
        vehicle.speedUp();
        vehicle.speedDown();

    }
}
